package com.wenhai.spring.event;

import org.springframework.context.ApplicationListener;

/**
 * 基于 Spring 监听自定义事件
 *
 * @author wenhai
 * @date   2021/4/20
 */
public class MySpringEventListener implements ApplicationListener<MySpringEvent> {

    @Override
    public void onApplicationEvent(MySpringEvent event) {
        System.out.println("MySpringEventListener#onApplicationEvent 接收到 Spring 事件：" + event + "， 线程id " + Thread.currentThread().getName());
    }
}
